<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-09-09 10:31:40
 * @LastEditors: voanit
 * @LastEditTime: 2022-09-11 14:51:35
-->
<script setup name="homeHot">
import HomePanel from "./home-panel.vue";
import useStore from "@/store";
const { home } = useStore();

import { useLazyData } from "@/utils/hooks";
const target = useLazyData(home.getHotList);
</script>
<template>
  <div class="home-new" ref="target">
    <HomePanel title="人气推荐" subTitle="人气爆款 不容错过">
      <!-- 面板内容 -->
      <!-- <ul class="goods-list" v-if="false"> -->
      <ul class="goods-list" v-if="home.hotGoodList.length > 0">
        <li v-for="item in home.hotGoodList" :key="item.id">
          <RouterLink to="/">
            <!-- <img :src="item.picture" alt="" /> -->
            <img v-lazy="item.picture" alt="" />
            <p class="name">{{ item.title }}</p>
            <p class="desc">{{ item.alt }}</p>
          </RouterLink>
        </li>
      </ul>
      <ul class="goods-list" v-else>
        <li v-for="item in home.hotGoodList" :key="item.id">
          <XtxSkeleton
            style="margin-right: 10px"
            :width="306"
            :height="406"
            animated
          ></XtxSkeleton>
        </li>
      </ul>
    </HomePanel>
  </div>
</template>
<style lang="less" scoped>
.goods-list {
  display: flex;
  justify-content: space-between;
  height: 406px;
  li {
    width: 306px;
    height: 406px;
    background: #f0f9f4;
    .hoverShadow();
    img {
      width: 306px;
      height: 306px;
    }
    p {
      font-size: 22px;
      padding: 12px 30px 0 30px;
      text-align: center;
    }

    .desc {
      color: #999;
      font-size: 18px;
    }
  }
}
</style>
